import React, { Component } from 'react'

import MyContext from '../context/Bus'

// import Cmp2 from './Cmp2'

export default class Cmp1 extends Component {

  // static contextType = MyContext

  state = {
    userinfo: {
      username: '张三',
      age: 20
    }
  }

  render() {
    // console.log(this.context);
    return (
      <div>
        {/* {this.context} */}

        {/* 发布一个消息 父子向下N多层的传递 祖先与后代的关系 */}
        {/* <MyContext.Provider value={this.state.userinfo}>
          <Cmp2 />
        </MyContext.Provider> */}
      </div>
    )
  }
}
